<template>
  <el-container>
    <el-main>
      <el-form ref="updateForm" size="small" :model="parmsValue" label-width="160px" :rules="form.rules" class="middle-form">
        <el-row>
          <el-col :span="12">
            <el-form-item prop="author_no" label="产品审批人">
              <el-select v-model="parmsValue.author_no" :clearable="true" :disabled="detailMod" @change="nameChange" @focus="getAuthor">
                <el-option v-for="(item,index) in dict.getProdSeriesByType2" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="author_identif" label="产品审批人身份证号">
              <el-input v-model="parmsValue.author_identif" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="design_no" label="产品设计人">
              <el-select v-model="parmsValue.design_no" :clearable="true" :disabled="detailMod" @focus="getDesign" @change="nameChange">
                <el-option v-for="(item,index) in dict.getProdSeriesByType3" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="design_identif" label="产品设计人身份证号">
              <el-input v-model="parmsValue.design_identif" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="manage_no" label="投资经理">
              <el-select v-model="parmsValue.manage_no" :clearable="true" :disabled="detailMod" @focus="getManage" @change="nameChange">
                <el-option v-for="(item,index) in dict.getProdSeriesByType1" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="manage_identif" label="投资经理证件号码">
              <el-input v-model="parmsValue.manage_identif" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="saleman_no" label="产品联络人">
              <el-select v-model="parmsValue.saleman_no" :clearable="true" :disabled="detailMod" @change="nameChange" @focus="getSaleman">
                <el-option v-for="(item,index) in dict.getProdSeriesByType5" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="saleman_phoneno" label="产品联络人座机">
              <el-input v-model="parmsValue.saleman_phoneno" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="saleman_telno" label="产品联络人手机">
              <el-input v-model="parmsValue.saleman_telno" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="saleman_email" label="产品联络人邮箱">
              <el-input v-model="parmsValue.saleman_email" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="sale_place" label="资金投向地区">
              <el-select v-model="parmsValue.sale_place" :clearable="true" :disabled="detailMod" @change="inputonchange1">
                <el-option v-for="(item,index) in dict.t8_zhz_sale_place" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="sale_place_name" label="产品投资国家或地区(境外)">
              <el-select v-model="parmsValue.sale_place_name" multiple :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_sale_place_name" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="srv_mode" label="理财业务服务模式">
              <el-select v-model="parmsValue.srv_mode" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_zhz_srv_mode" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="manage_mode" label="产品管理模式">
              <el-select v-model="parmsValue.manage_mode" :clearable="true" :disabled="detailMod" @change="managemodeChange">
                <el-option v-for="(item,index) in dict.t8_zhz_manage_mode" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="admin_name" label="实际管理人名称">
              <el-input v-model="parmsValue.admin_name" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="asset_maping" label="产品资产配置方式">
              <el-select v-model="parmsValue.asset_maping" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_zhz_asset_maping" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="pricing_type" label="产品定价方式">
              <el-select v-model="parmsValue.pricing_type" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_zhz_pricing_type" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="t8_invest_prop_type" label="投资性质分类">
              <el-select v-model="parmsValue.t8_invest_prop_type" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_invest_prop_type" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="prod_precent" label="投资资产种类及比例">
              <el-input v-model="parmsValue.prod_precent" type="textarea" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="structprod_subject" label="结构性存款挂钩标的类别">
              <el-select v-model="parmsValue.structprod_subject" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_structprod_subject" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="is_expe_rate" label="是否有预期收益率(中债)">
              <el-select v-model="parmsValue.is_expe_rate" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_is_empty_sf" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="is_basisofcount" label="是否有收益率测算依据(中债)">
              <el-select v-model="parmsValue.is_basisofcount" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_is_empty_sf" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="is_peer_exc" label="是否金融同业专属(中债)">
              <el-select v-model="parmsValue.is_peer_exc" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_is_empty_sf" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="is_min_htime" label="是否设置最短持有期限(中债)">
              <el-select v-model="parmsValue.is_min_htime" :clearable="true" :disabled="detailMod" @change="inputonchange2">
                <el-option v-for="(item,index) in dict.t8_is_empty_sf" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="min_htime" label="短持有期限(天)(中债)">
              <el-input v-model="parmsValue.t8_is_empty_sf" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="is_ransom_min_htime" label="最短持有期后是否自由赎回(中债)">
              <el-select v-model="parmsValue.is_ransom_min_htime" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_zhz_yesorno" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="is_cash_manage" label="是否现金管理类(中债)">
              <el-select v-model="parmsValue.is_cash_manage" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_is_empty_sf" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="cooperation_mode" label="合作模式">
              <el-select v-model="parmsValue.cooperation_mode" :clearable="true" :disabled="detailMod" @change="cooperation_mode_change">
                <el-option v-for="(item,index) in dict.t8_zhz_cooperation_mode" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="cooperation_org_name" label="合作机构名称">
              <el-input v-model="parmsValue.cooperation_org_name" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="return_cost" label="投资本金到账日">
              <el-select v-model="parmsValue.return_cost" :clearable="true" :disabled="detailMod" @change="changeProdDays">
                <el-option v-for="(item,index) in dict.t8_zhz_return_cost" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item prop="return_income" label="投资收益到账日">
              <el-select v-model="parmsValue.return_income" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_zhz_return_cost" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item prop="start_raise" label="募集起始日期(从)">
              <el-date-picker v-model="parmsValue.start_raise" format="yyyy-MM-dd" value-format="yyyyMMdd" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item prop="end_raise" label="募集起始日期(到)">
              <el-date-picker v-model="parmsValue.end_raise" format="yyyy-MM-dd" value-format="yyyyMMdd" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="report_scale" label="报备募集金额(中债)">
              <el-input v-model.number="parmsValue.report_scale" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="prod_credit_flag" label="产品增信标识">
              <el-select v-model="parmsValue.prod_credit_flag" :clearable="true" :disabled="detailMod" @change="prodCreFlag">
                <el-option v-for="(item,index) in dict.t8_zhz_is_not2" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="prod_credit_org" label="产品增信机构">
              <el-select v-model="parmsValue.prod_credit_org" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_zhz_credit_org" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="prod_credit_mod" label="产品增信形式">
              <el-select v-model="parmsValue.prod_credit_mod" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_zhz_up_credit" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="bank_prodsid" label="行内标识码">
              <el-input v-model="parmsValue.bank_prodsid" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="prod_brand" label="产品品牌">
              <el-input v-model="parmsValue.prod_brand" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="return_ccy" label="兑付本金币种">
              <el-select v-model="parmsValue.return_ccy" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.M8110EQ0012" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="income_ccy" label="兑付收益币种">
              <el-select v-model="parmsValue.income_ccy" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.M8110EQ0012" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="prod_times" label="产品期次">
              <el-input v-model="parmsValue.prod_times" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="open_mod" label="开放模式">
              <el-select v-model="parmsValue.open_mod" :clearable="true" :disabled="detailMod" @change="open_mod_change">
                <el-option v-for="(item,index) in dict.t8_open_mod" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="regular_open_cycle" label="规律开放周期">
              <el-select v-model="parmsValue.regular_open_cycle" :clearable="true" :disabled="detailMod" @change="regular_open_cycle_change">
                <el-option v-for="(item,index) in dict.t8_regular_open_cycle" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="oth_regul_open_cyc" label="其他规律开放周期">
              <el-input v-model.number="parmsValue.oth_regul_open_cyc" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="irregular_open_desc" label="无规律开放说明">
              <el-input v-model="parmsValue.irregular_open_desc" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="first_open_date" label="首次开放周期起始日">
              <el-date-picker v-model="parmsValue.first_open_date" format="yyyy-MM-dd" value-format="yyyyMMdd" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="is_open_in_holidya" label="节假日是否开放">
              <el-select v-model="parmsValue.is_open_in_holidya" :clearable="true" :disabled="detailMod">
                <el-option v-for="(item,index) in dict.t8_1yes0no" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="open_times" label="平均开放次数(年化)">
              <el-input v-model.number="parmsValue.open_times" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="open_period_business" label="开放期业务">
              <el-select v-model="parmsValue.open_period_business" :clearable="true" :disabled="detailMod" @change="open_period_business_change">
                <el-option v-for="(item,index) in dict.t8_open_period_business" :key="index" :value="index" :label="item" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="open_peri_busi_desc" label="开放期业务说明">
              <el-input v-model="parmsValue.open_peri_busi_desc" :clearable="true" :disabled="detailMod" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-main>
  </el-container>
</template>

<script>
  import { formItems } from '@/utils/formItems'
  import request from '@/utils/request'
  import axios from 'axios'

  export default {
    props: {
      editMod: {
        type: String,
        default: 'ADD'
      },
      parmsValue: {
        type: Object,
        default: () => {
          return {
            author_no: '',
            author_identif: '',
            design_no: '',
            design_identif: '',
            manage_no: '',
            manage_identif: '',
            saleman_no: '',
            saleman_phoneno: '',
            saleman_telno: '',
            saleman_email: '',
            sale_place: '',
            sale_place_name: '',
            srv_mode: '',
            manage_mode: '',
            admin_name: '',
            asset_maping: '',
            pricing_type: '',
            t8_invest_prop_type: '',
            prod_precent: '',
            structprod_subject: '',
            is_expe_rate: '',
            is_basisofcount: '',
            is_peer_exc: '',
            is_min_htime: '',
            min_htime: '',
            is_ransom_min_htime: '',
            is_cash_manage: '',
            cooperation_mode: '',
            cooperation_org_name: '',
            return_cost: '',
            return_income: '',
            start_raise: '',
            end_raise: '',
            report_scale: '',
            prod_credit_flag: '',
            prod_credit_org: '',
            prod_credit_mod: '',
            bank_prodsid: '',
            prod_brand: '',
            return_ccy: '',
            income_ccy: '',
            prod_times: '',
            open_mod: '',
            regular_open_cycle: '',
            oth_regul_open_cyc: '',
            irregular_open_desc: '',
            first_open_date: '',
            is_open_in_holidya: '',
            open_times: '',
            open_period_business: '',
            open_peri_busi_desc: ''
          }
        }
      }
    },
    data() {
      return {
        dict: {
          t8_zhz_sale_place: {},
          t8_sale_place_name: {},
          t8_zhz_srv_mode: {},
          t8_zhz_manage_mode: {},
          t8_zhz_asset_maping: {},
          t8_zhz_pricing_type: {},
          t8_structprod_subject: {},
          t8_is_empty_sf: {},
          t8_zhz_cooperation_mode: {},
          t8_zhz_is_not2: {},
          t8_zhz_credit_org: {},
          t8_zhz_up_credit: {},
          t8_open_mod: {},
          t8_regular_open_cycle: {},
          t8_open_period_busines: {},
          getProdSeriesByType2: {},
          getProdSeriesByType1: {},
          getProdSeriesByType5: {},
          getProdSeriesByType3: {},
          M8110EQ0012: {}
        },
        form: {
          rules: {
            author_no: [{ required: true, message: '产品审批人必填', trigger: 'change' }],
            author_identif: [{ required: true, message: '产品审批人身份证号必填', trigger: 'change' }],
            design_no: [{ required: true, message: '产品设计人必填', trigger: 'change' }],
            design_identif: [{ required: true, message: '产品设计人身份证号必填', trigger: 'change' }],
            manage_no: [{ required: true, message: '投资经理必填', trigger: 'change' }],
            manage_identif: [{ required: true, message: '投资经理证件号码必填', trigger: 'change' }],
            saleman_no: [{ required: true, message: '产品联络人必填', trigger: 'change' }],
            saleman_phoneno: [{ required: true, message: '产品联络人座机必填', trigger: 'change' }],
            saleman_telno: [{ required: true, message: '产品联络人手机必填', trigger: 'change' }],
            saleman_email: [{ required: true, message: '产品联络人邮箱必填', trigger: 'change' }],
            sale_place: [{ required: true, message: '资金投向地区必填', trigger: 'change' }],
            sale_place_name: [{ required: true, message: '产品投资国家或地区必填', trigger: 'change' }],
            srv_mode: [{ required: true, message: '理财业务服务模式必填', trigger: 'change' }],
            manage_mode: [{ required: true, message: '产品管理模式必填', trigger: 'change' }],
            admin_name: [{ required: true, message: '实际管理人名称必填', trigger: 'change' }],
            asset_maping: [{ required: true, message: '产品资产配置方式必填', trigger: 'change' }],
            pricing_type: [{ required: true, message: '产品定价方式必填', trigger: 'change' }],
            t8_invest_prop_type: [{ required: true, message: '投资性质分类必填', trigger: 'change' }],
            prod_precent: [{ required: true, message: '投资资产种类及比例必填', trigger: 'change' }],
            structprod_subject: [{ required: true, message: '结构性存款挂钩标的类别必填', trigger: 'change' }],
            is_expe_rate: [{ required: true, message: '是否有预期收益率必填', trigger: 'change' }],
            is_basisofcount: [{ required: true, message: '是否有收益率测算依据必填', trigger: 'change' }],
            is_peer_exc: [{ required: true, message: '是否金融同业专属必填', trigger: 'change' }],
            is_min_htime: [{ required: true, message: '是否设置最短持有期限必填', trigger: 'change' }],
            min_htime: [{ required: true, message: '短持有期限必填', trigger: 'change' }],
            is_ransom_min_htime: [{ required: true, message: '最短持有期后是否自由赎回必填', trigger: 'change' }],
            is_cash_manage: [{ required: true, message: '是否现金管理类必填', trigger: 'change' }],
            cooperation_mode: [{ required: true, message: '合作模式必填', trigger: 'change' }],
            cooperation_org_name: [{ required: true, message: '合作机构名称必填', trigger: 'change' }],
            return_cost: [{ required: true, message: '投资本金到账日必填', trigger: 'change' }],
            return_income: [{ required: true, message: '投资收益到账日必填', trigger: 'change' }],
            start_raise: [{ required: true, message: '募集起始日期必填', trigger: 'change' }],
            end_raise: [{ required: true, message: '募集起始日期必填', trigger: 'change' }],
            report_scale: [{ required: true, message: '报备募集金额必填', trigger: 'change' }],
            prod_credit_flag: [{ required: true, message: '产品增信标识必填', trigger: 'change' }],
            prod_credit_org: [{ required: true, message: '产品增信机构必填', trigger: 'change' }],
            prod_credit_mod: [{ required: true, message: '产品增信形式必填', trigger: 'change' }],
            bank_prodsid: [{ required: true, message: '行内标识码必填', trigger: 'change' }],
            prod_brand: [{ required: true, message: '产品品牌必填', trigger: 'change' }],
            return_ccy: [{ required: true, message: '兑付本金币种必填', trigger: 'change' }],
            income_ccy: [{ required: true, message: '兑付收益币种必填', trigger: 'change' }],
            prod_times: [{ required: true, message: '产品期次必填', trigger: 'change' }],
            open_mod: [{ required: true, message: '开放模式必填', trigger: 'change' }],
            regular_open_cycle: [{ required: true, message: '规律开放周期必填', trigger: 'change' }],
            oth_regul_open_cyc: [{ required: true, message: '其他规律开放周期必填', trigger: 'change' }],
            irregular_open_desc: [{ required: true, message: '无规律开放说明必填', trigger: 'change' }],
            first_open_date: [{ required: true, message: '首次开放周期起始日必填', trigger: 'change' }],
            is_open_in_holidya: [{ required: true, message: '节假日是否开放必填', trigger: 'change' }],
            open_times: [{ required: true, message: '平均开放次数必填', trigger: 'change' }],
            open_period_business: [{ required: true, message: '开放期业务必填', trigger: 'change' }],
            open_peri_busi_desc: [{ required: true, message: '开放期业务说明必填', trigger: 'change' }]
          }
        }
      }
    },
    computed: {
      updateMod() {
        return this.editMod === 'update'
      },
      detailMod() {
        return this.editMod === 'detail'
      },
      addMod() {
        return this.editMod === 'add'
      }
    },
    // 生命周期开始
    activated() {
      this.init()
    },
    // 生命周期结束
    methods: {
      /**
       *
       * 初始化数据，用于数据字典的获取，页面进入时调用一次，常为保持请求同步而在数据字典请求回调后请求表格数据等
       *
       **/
      init() {
        /**
         * dict类型数据字典获取
         **/
        const dictReq = []
        const dicts = ['t8_zhz_sale_place', 't8_sale_place_name', 't8_zhz_srv_mode', 't8_zhz_manage_mode', 't8_zhz_asset_maping', 't8_zhz_pricing_type',
                       't8_structprod_subject', 't8_is_empty_sf', 't8_zhz_cooperation_mode', 't8_zhz_is_not2', 't8_zhz_credit_org', 't8_zhz_up_credit',
                       't8_open_mod', 't8_regular_open_cycle', 't8_open_period_business']
        dicts.forEach(key => dictReq.push(request({ url: 'system/base/dict/' + key + '.json', method: 'post', loading: true })))
        axios.all(dictReq).then(axios.spread((...item) => {
          for (let i = 0; i < dicts.length; i++) {
            this.dict[dicts[i]] = item[i]
          }
        }))

        /**
         * exeid类型数据字典获取
         **/
        const exeidReq = []
        const exeids = [
          { service: formItems.DATA, params: { exeid: 'getProdSeriesByType', cust_type: '02' }, dict: 'getProdSeriesByType2' },
          { service: formItems.DATA, params: { exeid: 'getProdSeriesByType', cust_type: '01' }, dict: 'getProdSeriesByType1' },
          { service: formItems.DATA, params: { exeid: 'getProdSeriesByType', cust_type: '05' }, dict: 'getProdSeriesByType5' },
          { service: formItems.DATA, params: { exeid: 'getProdSeriesByType', cust_type: '03' }, dict: 'getProdSeriesByType3' },
          { service: formItems.PROD, params: { exeid: 'M8110EQ0012' }}
        ]
        exeids.forEach(item => exeidReq.push(request({
          url: '/' + item.service + '/base/comn-query.json', method: 'post', loading: true, params: item.params
        })))
        axios.all(exeidReq).then(axios.spread((...items) => {
          for (let i = 0; i < exeids.length; i++) {
            if (exeids[i].dict) {
              this.dict[exeids[i].dict] = items[i].rows
            } else {
              this.dict[exeids[i].params.exeid] = items[i].rows
            }
          }
        }))
      },
      nameChange() {
      },
      getAuthor() {
      },
      getDesign() {
      },
      getManage() {
      },
      getSaleman() {
      },
      inputonchange1() {
      },
      managemodeChange() {
      },
      inputonchange2() {
      },
      t8_zhz_yesorno() {
      },
      cooperation_mode_change() {
      },
      changeProdDays() {
      },
      prodCreFlag() {
      },
      open_mod_change() {
      },
      regular_open_cycle_change() {
      },
      open_period_business_change() {
      }
    }
  }
</script>
